package GenericStudy.Exa1;

import java.util.LinkedList;

public class ObjectStack {

    //嵌套一个LinkedList来实现Stack
    private LinkedList container = new LinkedList<>();

    //弹入元素
    public void push(Object t) {
        container.addFirst(t);
    }
    //弹出元素
    public Object pop() {
        return container.removeFirst();
    }
    //判断栈容量是否为空
    public boolean empty() {
        return container.isEmpty();
    }
}
